import React, { Component } from 'react'; 

export default class GChild extends Component {
	state = {
		name: 'h111'
	}
	componentDidMount(){
		this.props.onRef(this)
		console.log(this) // ->将EightteenChildFour传递给父组件this.props.onRef()方法
	}
	testfn = () => {
		console.log('GChild', 'testfn', this.state);
		this.setState({name:'h222'})
	}
	// 渲染函数
    render() {
    	return (
			<div>
				<div onClick={this.testfn}>GChild:点击事件:{this.state.name}</div>
			</div>
		);
    }
};
